package com.resouxs.free_book.service;

import android.os.Parcel;
import android.os.Parcelable;

public class ZsChapter implements Parcelable {
    private String title;
    private String link;
    private boolean unreadble;

    private String isPay;
    private String isVip;

    //自己加的字段
    private boolean isCached;
    private int chapterSum;
    private int chapterIndex;
    private String bookName;
    private String shareUrl;
    private String bookId;
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public boolean isUnreadble() {
        return unreadble;
    }

    public void setUnreadble(boolean unreadble) {
        this.unreadble = unreadble;
    }

    public String getIsPay() {
        return isPay;
    }

    public void setIsPay(String isPay) {
        this.isPay = isPay;
    }

    public String getIsVip() {
        return isVip;
    }

    public void setIsVip(String isVip) {
        this.isVip = isVip;
    }

    public boolean isCached() {
        return isCached;
    }

    public void setCached(boolean cached) {
        isCached = cached;
    }

    public int getChapterSum() {
        return chapterSum;
    }

    public void setChapterSum(int chapterSum) {
        this.chapterSum = chapterSum;
    }

    public int getChapterIndex() {
        return chapterIndex;
    }

    public void setChapterIndex(int chapterIndex) {
        this.chapterIndex = chapterIndex;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getShareUrl() {
        return shareUrl;
    }

    public void setShareUrl(String shareUrl) {
        this.shareUrl = shareUrl;
    }

    public String getBookId() {
        return bookId;
    }

    public void setBookId(String bookId) {
        this.bookId = bookId;
    }

    @Override
    public String toString() {
        return "ZsChapter{" +
                "title='" + title + '\'' +
                ", link='" + link + '\'' +
                ", unreadble=" + unreadble +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.title);
        dest.writeString(this.link);
        dest.writeByte(this.unreadble ? (byte) 1 : (byte) 0);
        dest.writeString(this.isPay);
        dest.writeString(this.isVip);
        dest.writeByte(this.isCached ? (byte) 1 : (byte) 0);
        dest.writeInt(this.chapterSum);
        dest.writeInt(this.chapterIndex);
        dest.writeString(this.bookName);
        dest.writeString(this.shareUrl);
        dest.writeString(this.bookId);
    }

    public ZsChapter() {
    }

    protected ZsChapter(Parcel in) {
        this.title = in.readString();
        this.link = in.readString();
        this.unreadble = in.readByte() != 0;
        this.isPay = in.readString();
        this.isVip = in.readString();
        this.isCached = in.readByte() != 0;
        this.chapterSum = in.readInt();
        this.chapterIndex = in.readInt();
        this.bookName = in.readString();
        this.shareUrl = in.readString();
        this.bookId = in.readString();
    }

    public static final Parcelable.Creator<ZsChapter> CREATOR = new Parcelable.Creator<ZsChapter>() {
        @Override
        public ZsChapter createFromParcel(Parcel source) {
            return new ZsChapter(source);
        }

        @Override
        public ZsChapter[] newArray(int size) {
            return new ZsChapter[size];
        }
    };
}
